package com.cy.milktea.mapper;

import com.cy.milktea.pojo.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

@Mapper
public interface RoleMapper {

    int insert(Role role);

    int delete(Integer id);

    int update(Role role);

    List<Role> selectAllWithMenus(Integer status);

    Set<String> selectPermissions(Integer roleId);

    @Select("select id from tb_role where name = #{name}")
    int selectIdByRoleName(String name);

    List<Role> selectAllWithMenuIds();
}
